<table summary="" id="pagehead" cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td><h1>报修管理</h1></td>
		<td class="actions">
			<table summary="" cellpadding="0" cellspacing="0" border="0" align="right">
				<tr>
                	<td <?=$this->view_act ?>><a href="?app=baoxiu&mod=baoxiumanage">报修列表</a></td>
					<td <?=$this->add_act ?>><a href="?app=baoxiu&mod=baoxiumanage&opt=add" id="add_table">添加报修</a></td>
                    <td <?=$this->dec_act ?>><a href="#">查看报修</a></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<?php if($this->opt=='view'): ?>
<div class="t_2">
     <div class="fl">报修信息列表</div>
     <div class="fr add_form"></div>
</div>
<div class="search">
    <form id='search'>
        <span>
            客户名称:<input type="text" name="customname" id="customname" value="" />
        </span>
        <span><input type="submit" value="搜索" /><?php echo showhide(array('app'=>APP,'mod'=>MOD)); ?></span>
    </form>
</div>
<div class="line_1"></div>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="table1">
       <tr>
            <th class="th0" rel="bid">编号</th>
            <th class="th0">客户</th>
            <th class="th0">标题</th>
            <th class="th1" rel="">发布时间</th>
            <th class="th0">操作</a>
       </tr>
       <?php foreach((array)$this->lists as $list): ?> 
       <tr>
            <td><?php echo $list['bid']; ?></td>
            <td><?php echo $list['customer_name']; ?></td>
            <td><?php echo $list['title']; ?></td>
            <td><?php echo date('Y-m-d H:i:s',$list['created_time']); ?></td>
            <td>
            	<?=opt('view','?app='.APP.'&mod=baoxiumanage&opt=dec&bid='.$list['bid'], ' title ="浏览" '); ?>
            	<? //=opt('edit','?app='.APP.'&mod=edit&bid='.$list['bid'], ' title ="编辑" '); ?>
            </td>
       </tr>
       <?php endforeach; ?>
</table>
<div class="page_num">
     <div class="fl">
        <span></span>
     </div>
     <div class="fr">
        <p class="cpager">
            <?php echo $this->pager; ?>
        </p>
     </div>
</div>
<?php elseif($this->opt=='add' || $this->opt=='edit'): ?>

<script>
$(function(){
    $('#form').submit(function(){
        // ajax发送数据
        $.post(location.href,$(this).serialize(),function(data){
            if (data.state <= 0)
            {
                $('#'+data.extra).focus();
                alert(data.message);
                return false;
            }
            //dialogMessage(data.message,'green');
			alert(data.message);
			location.href = "?app=<?=APP?>&mod=baoxiumanage";
        },'json');
        return false;
    });
});
</script>
<div class="edit_tab tab">
<div class="bg1">
<div class="bg2">
      <span rel="info" class="span_now">添加报修信息</span>
</div>
</div>
</div>
<div >
<table cellspacing="2" cellpadding="2" class="helptable"><tr><td>
<ul>
	<li><b>小提示</b></li>
	<li>(1) <span style="color:red;">红色</span>项为必填项</li>
</ul>
</td></tr>
</table>
</div>
<form id="form">
<div class="post_form" id="info_form">
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="info_table">
		<tr>
			<td class="td2">标题：</td>
			<td><span><input type="text" style='width:200;' name="title" id="title" value="<?=$this->baoxiu['title']?>" /><font color="#848484"></font></span></td>
		</tr>
        <tr>
			<td class="td2">客户：</td>
			<td><span>
            	<?=$this->customers?>
            </span></td>
		</tr>
		<tr>
			<td class="td2">内容：</td>
			<td>
            	<textarea name="content" id="content" rows="8" cols="80"><?=$this->baoxiu['content']?></textarea>
            </td>
		</tr>
        <tr>
			<td class="td2">下级操作员：</td>
			<td>
				<select name="next_uid" >
					<option value="">请选择</option>
					<?php foreach((array)$this->next_user_list as $user): ?>
					<option value="<?=$user['uid']?>"><?=$user['username']?>[<?=$user['nickname']?>]</option>
					<?php endforeach; ?>
				</select>
			</td>
		</tr>
		<tr>
			<td colspan="2" style="text-align:center" class="td1">
            	<input type="submit" value="提交"/>
                <input type="hidden" id="bid" name="bid" value="<?=$this->baoxiu['bid']?>"/>
            	<input name="" type="reset" class="btn1" value="重置" />
            </td>
		</tr>
     </table>
</div>
</form>

<?php elseif($this->opt=='dec'): ?>

<div class="edit_tab tab">
<div class="bg1">
<div class="bg2">
      <span rel="info" class="span_now">查看报修信息</span>
</div>
</div>
</div>
<div >
</div>
<div class="post_form" id="info_form">
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="info_table">
    	<tr>
			<td class="td1">审批状态：</td>
			<td><span><?=$this->state?></span></td>
		</tr>
        <tr>
			<td class="td1">客户：</td>
			<td><span><?=$this->baoxiu['customer_name']?></span></td>
		</tr>
		<tr>
			<td class="td1">标题：</td>
			<td><span><?=$this->baoxiu['title']?></span></td>
		</tr>
		<tr>
			<td class="td1">内容：</td>
			<td>
            	<?=$this->baoxiu['content']?>
            </td>
		</tr>
        <tr>
			<td class="td1">信息反馈：</td>
			<td>
           	<?=$this->baoxiu['mark']?>
            </td>
		</tr>
        <tr>
			<td colspan="2" align="center"><input type="button"  value="返回" onClick="javascript:history.back(-1);" /></td>
		</tr>
     </table>
</div>
<?php endif; ?>